﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RemoteTestRunner.Contracts;

namespace RemoteTestRunner.BusinessLogic.ViewModels
{
    public class RunTestsCommand : ICommand
    {
        private Project _project;
        private Test _test;
        private int _timeout;
        private List<string> _selectedClassesAndMethods;
        private IRtrService _rtrService;
        public TestResultSummary Result { get; set; }

        public RunTestsCommand(Project project, Test test, int timeout, List<string> selectedClassesAndMethods, IRtrService rtrService)
        {
            _project = project;
            _test = test;
            _timeout = timeout;
            _selectedClassesAndMethods = selectedClassesAndMethods;
            _rtrService = rtrService;
        }

        public void Execute()
        {
            Result = _rtrService.RunTest(_project, _test, _selectedClassesAndMethods, _timeout);
        }
    }
}
